<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Delete.aspx.cs" Inherits="Delete" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<script type="text/javascript">
function confirmDelete()
{
  var x = confirm("Are you sure you want to delete these items?");
  if (x)
  { return true;
  }
  else
  { alert("Delete cancelled.");
    return false;
  }
}
</script>
<head id="Head1" runat="server">
    <title>Load Test Reporting</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table  cellpadding="1" cellspacing="1" border="0" style="width: 813px; ">
            <tr style="height: 75px"><td colspan="5" align="center"><asp:label id="Label1" runat="server" Font-Bold="True" Font-Size="X-Large" Width="100%" BackColor="Transparent"
							 ForeColor="#004040" >Load Test Maintenance/Reporting</asp:label></td>
			</tr>
			<tr> 
			    <td style="width: 23%; height: 23px;">
			        <asp:Label id="Label2" runat="server"> Results for past # of Days:</asp:Label>
			    </td>
			    <td style="width: 20%; height: 23px;" align="left">
			        <asp:DropDownList ID="ddTimeSpan" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddTimeSpan_SelectedIndexChanged">
                    </asp:DropDownList>
			    </td>
			    <td style="width: 10%; height: 23px;">
			        <asp:Label id="lblLoadTests" runat="server"> Load Tests:    </asp:Label>
			    </td>
			    <td style="width: 20%">
			        <asp:DropDownList ID="ddLoadTests" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddLoadTests_SelectedIndexChanged">
                    </asp:DropDownList>
			    </td>
			    <td align ="right" style="height: 23px">
			        <asp:LinkButton ID="btnHome" Text="Home" runat="server" OnClick="btnHome_Click"/>
			    </td>
			</tr>
            <tr >                
                <td valign="top" align="left" colspan="5">
                    <asp:GridView ID="gvDeleteRuns" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="LoadTestRunId" DataSourceID="SqlDataSource1"
        AllowPaging ="True"
        AllowSorting = "True"  
        PageSize="10"      
        BorderColor="#CCCCCC" 
        BorderStyle="None" 
        BorderWidth="1px" 
        BackColor="White" 
        CellPadding="3" 
        Width="100%" 
        EmptyDataText="No Data Available"
        OnPageIndexChanging="gvDeleteRuns_PageIndexChanging" 
        OnPreRender="gvDeleteRuns_PreRender">
        <FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>
		<SelectedRowStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedRowStyle>
		<RowStyle Font-Size="Smaller" ForeColor="#000066"></RowStyle>
		<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#006699"></HeaderStyle>
    <Columns>
        <asp:BoundField DataField="LoadTestRunId" HeaderText="LoadTestRunId" InsertVisible="False"
            ReadOnly="True" SortExpression="LoadTestRunId" Visible="False" ShowHeader="False" />
        <asp:TemplateField HeaderText="" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="Center">
            <HeaderTemplate>
                <asp:CheckBox ID="chkHeader" runat="server" OnCheckedChanged="chkSelectAll_Click" AutoPostBack="true"  />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server"  />
            </ItemTemplate>
        </asp:TemplateField>
                
        <asp:BoundField DataField="LoadTestName" HeaderText="Load Test Name" SortExpression="LoadTestName" ItemStyle-Width="15%"/>
        <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" ItemStyle-Width="30%"/>
        <asp:BoundField DataField="StartTime" HeaderText="StartTime" SortExpression="StartTime" ItemStyle-Width="18%"/>
        <asp:BoundField DataField="EndTime" HeaderText="EndTime" SortExpression="EndTime" ItemStyle-Width="18%"/>
                      
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:LoadTestConnectionString %>" 
            SelectCommandType="StoredProcedure"
            SelectCommand="dbo.[RPT_SelectLoadTestSummary]"
            DeleteCommandType="StoredProcedure"
            DeleteCommand="dbo.[Prc_DeleteLoadTestRun]">
            <DeleteParameters>
                <asp:Parameter Name="LoadTestRunId" Type="Int32" />
            </DeleteParameters>
            <SelectParameters>
                <asp:Parameter Name="LoadTestName" Type="String" />
                <asp:Parameter Name="PastDays" Type="Int32" />
            </SelectParameters>            
</asp:SqlDataSource>
                </td>
            </tr>
            <tr> 
                <td colspan="5">                    
                    <asp:Button ID="btnDeleteCheckedRuns" Text="Delete Checked Runs" runat="server" OnClick="btnDeleteCheckedRuns_Click"/>                    
                </td>                
            </tr>
        
        </table>
    </div>
    </form>
</body>
</html>
